﻿@{
    ViewBag.Title = "BeginSchedule";
    Layout = "~/Views/Shared/_ScheduleClass_View.cshtml";
}

@section headerPartial {

}


<div id="divbody" style="min-height: 510px;">
    <div class="container" id="divcon">
        <link href="/Static/Template/css/btnDiv.css" rel="stylesheet" type="text/css">
        <link href="/Static/Template/css/start.css" rel="stylesheet" type="text/css">
        <link href="/Static/Template/css/step-box.css" rel="stylesheet">
        <div id="divBody">
            <style>
                a.view-course-plan {
                    padding-left: 25px;
                    background-repeat: no-repeat;
                    margin-left: 10px;
                    text-decoration: none;
                    padding-bottom: 5px;
                }



                li.pos {
                    margin-left: 15px;
                }

                .list-inline a {
                    text-decoration: none;
                    padding-left: 25px;
                    padding-bottom: 5px;
                }
            </style>
            <div class="row" style="margin-top: 20px;">
                <div class="col-md-8">
                    <ul class="list-inline">
                        <li>
                            <a href="OperatorClassDetail?id=@(ViewBag.taskid)" id="baseInfo" class="task-baseInfo">基础信息</a>
                        </li>
                        <li class="pos">
                            <a href="ruleIndex?taskid=@(ViewBag.taskid)" id="rule" class="task-rule task-rule-active">规则条件</a>
                        </li>

                        <li class="pos">
                            <a href="javascript:void()" id="auto" class="task-auto active">开始排课</a>
                        </li>
                    </ul>
                </div>

                <div class="col-md-2 col-md-offset-2">
                    <div class="dropdown" style="float: right;">
                        <button id="btnQuestions" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" class="btn btn-default dropdown-toggle">
                            排课遇到难题
                               
                            <span class="caret"></span>
                        </button>
                        <ul id="questions-list" class="dropdown-menu dropdown-menu-right" aria-labelledby="btnQuestions">
                            <li>
                                <a href="http://bbs.yunxiao.com/forum.php?mod=viewthread&amp;tid=2928&amp;extra=page%3D1"
                                    target="_blank">已完成自动排课，但存在冲突？</a>
                            </li>
                            <li>
                                <a href="http://bbs.yunxiao.com/forum.php?mod=viewthread&amp;tid=2928&amp;extra=page%3D1"
                                    target="_blank">找不到某个班级的初始解，请减少约束条件？</a>
                            </li>
                            <li>
                                <a href="http://bbs.yunxiao.com/forum.php?mod=viewthread&amp;tid=2928&amp;extra=page%3D1"
                                    target="_blank">在课时设置时总课时数是足够的，但点击“自动排课”后显示某班级实际总课时不够?</a>
                            </li>
                            <li>
                                <a href="http://bbs.yunxiao.com/forum.php?mod=viewthread&amp;tid=2928&amp;extra=page%3D1"
                                    target="_blank">“偏好设置”有什么帮助？</a>
                            </li>
                            <li>
                                <a href="http://bbs.yunxiao.com/forum.php?mod=viewthread&amp;tid=2928&amp;extra=page%3D1"
                                    target="_blank">点击“开始自动排课”网页没有反应？</a>
                            </li>
                        </ul>
                    </div>
                </div>
            </div>

            <script src="/Static/Template/js/course-plan.js" charset="utf-8"></script>


            <div class="row" style="margin-top: 20px">
                <div class="col-md-8">
                    剩下的工作交给云校吧~
                   
                </div>
            </div>
            <div style="margin-top: 10px; border-top: 1px solid #0599f7"></div>
            <!--弹出冲突列表-->
            <style type="text/css">
                .conflictInfo {
                    border-collapse: collapse;
                    border: none;
                    width: 100%;
                }

                    .conflictInfo td {
                        border: solid #c0c0c0 1px;
                        vertical-align: middle;
                        padding-left: 5px;
                        padding-right: 5px;
                        padding-top: 5px;
                        padding-bottom: 5px;
                        text-align: left;
                    }

                    .conflictInfo th {
                        border: solid #c0c0c0 1px;
                        vertical-align: middle;
                        min-width: 55px;
                        text-align: center;
                        background-color: #DFDFDF;
                        height: 30px;
                    }

                .pwait {
                    margin-left: 10px;
                    color: #ff0000;
                    display: table-cell;
                    vertical-align: middle;
                    text-align: center;
                    font-weight: bold;
                    font-size: 18px;
                    letter-spacing: 3px;
                }

                #divConflict {
                    text-align: center;
                    vertical-align: middle;
                    width: 100%;
                    height: 300px;
                    overflow: auto;
                    max-height: 300px;
                    display: table;
                }

                #ruleListModal .modal .modal-dialog {
                    width: 900px;
                }

                #ruleListModal .modal-body {
                    height: 400px;
                    overflow-y: auto;
                    overflow-x: hidden;
                    margin-bottom: 30px;
                }

                #ruleListModal table {
                    text-align: center;
                    border: 1px solid #c6c6c6;
                }

                    #ruleListModal table thead {
                        background-color: #ef755d;
                        color: #ffffff;
                    }

                /*endregion 规则列表*/
            </style>

            <link href="/Static/Template/css/ruleDialog.css" rel="stylesheet">
            <style>
                #ruleListTable_body td {
                    padding: 8px;
                    font-size: 14.8px;
                    text-align: left;
                }

                #ruleListModal table thead > tr > th {
                    background-color: #ef755d;
                }
            </style>
            <!--规则列表 Modal -->

            <script src="/Static/Template/js/rule-statistic.js" charset="UTF-8"></script>
            <script src="/Static/Template/js/rule-view.js" charset="UTF-8"></script>
            <div class="operationArea" id="operationArea">
                <div>
                    <button class="btn btn-danger btn-begin" data-toggle="modal" data-taskid="@(ViewBag.taskid)">
                        <img src="/Static/img/face/smiley_16.png">&nbsp;&nbsp; 开始自动排课</button>
                </div>
            </div>

            <div id="stepArea" style="height: 70px;">
                <div id="stepBox" class="text-right stepBoxFixed2" style="bottom: 57px;">
                    <button type="button" class="btn btn-primary btn-sm" id="btnNext" onclick="window.location.href='MergeClassConfig?taskid=@(ViewBag.taskid)'">
                        上一步
                    </button>
                </div>
            </div>
        </div>
    </div>
</div>


<!-- 提示用户正在生成排课表 -->
<div class="modal fade" id="sheduleModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <button hidden="hidden" type="button" class="close" data-dismiss="modal" aria-label="Close">
                    <span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title" id="myModalLabel">排课任务</h4>
            </div>
            <div class="modal-body">
                <h2>排课任务正在进行中....请稍后....</h2>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-primary" style="display:none;" data-dismiss="modal">好的</button>
            </div>
        </div>
    </div>
</div>


@section scripts {
    <script type="text/ecmascript">
        $(".btn-begin").on("click", function () {
            $(".modal-body").find("h2").text("排课任务正在进行中....请稍后....");
            // alert("草啊!");
            var $this = $(this);
            $this.attr("data-target", "#sheduleModal");
            var taskid = $this.attr("data-taskid");
            $.get("CreateDataTxt", { taskid: taskid }, function (data) {
                if (data.status) {
                    $(".modal-body").find("h2").text("排课任务排课完毕!");
                    $(".modal-footer").find("button").show();
                }
            })
        });

    </script>
}